<?php

namespace app\agent\validate;

use think\Validate;

class User extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'username'  => 'require|unique:user',
        'password'  => 'require|confirm',
        'mobile'    => 'require|unique:user|regex:/^1[34578]\d{9}$/'
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'username.unique'   => '该账号已经存在',
        'username.require'  => '该账号已经存在',
        'password.confirm'  => '两次密码输入不一致',
        'mobile.unique'     => '该手机号已存在',
        'mobile.regex'      => '手机号码格式不正确'
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => [],
        'edit' => [],
    ];
    
}
